import { createStore } from 'vuex'

const store = createStore({
  state() {
    return {
      loginUser: {}
    }
  },
  getters: {},
  actions: {},
  mutations: {
    setLoginUser(state, payload) {
      state.loginUser = payload
    },
    logout(state, payload) {
      // 退出登录，清空用户信息
      state.loginUser = {}
    }
  }
})

export default store
